package org.example.udemo1;

import org.example.udemo1.controller.UserController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class Udemo1Application {

	public static void main(String[] args) {
//		SpringApplication.run(Udemo1Application.class, args);

		//底层就是反射机制
		//上下文就是
		ApplicationContext context = SpringApplication.run(Udemo1Application.class, args);
		UserController bean = context.getBean(UserController.class);

		UserController userController = (UserController) context.getBean("userController1");

		UserController userController1 = context.getBean("userController1", UserController.class);

//		UserService bean = context.getBean(UserService.class);
//		bean.say();
//		UserService bean2 = context.getBean("UserService",UserService.class);
//		UserService bean3 = (UserService)context.getBean("bean3");
	}

}
